package com.passion.mq.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

/**
 * 类描述：rocketmq配置类
 *
 * @author ZhuYin
 * @since 2024年12月17日
 */
@Slf4j
@Configuration
@ConditionalOnProperty(prefix = "archives.mq", name = "type", havingValue = "rocketmq")
public class RocketMqConfig {

    public static String nameServer;
    public static String consumerGroup;

    @Value("${rocketmq.name-server}")
    public void setNameServer(String nameServer) {
        RocketMqConfig.nameServer = nameServer;
    }

    @Value("${rocketmq.consumer.group}")
    public void setConsumerGroup(String consumerGroup) {
        RocketMqConfig.consumerGroup = consumerGroup;
    }
}
